package it.gommonauti.quiz.patente.app;


import android.content.Intent;
import android.graphics.Typeface;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageButton;

/**
 * 
 * @author Francesco Stallone ( f.stallone73@gmail.com ).
 * @author gianlucaatwork@gmail.com.
 *
 * The main activity.
 */
public class ChooseQuizActivity extends BaseActivity {

	private static final String DEBUG_TAG= "ChooseQuizActivity";	

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {

		Log.i(DEBUG_TAG, "onCreate()");

		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		
		// TODO : externaliza
		Typeface tf = Typeface.createFromAsset(getAssets(), "ASTRO867.TTF");
		
		//Temporary: Call RandomQuizActivity using a button
		//ImageButton btnRandon = (ImageButton) findViewById(R.id.btnCallRandom);
		Button btnRandon = (Button) findViewById(R.id.btnCallRandom);
		btnRandon.setTypeface(tf);
		btnRandon.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {

				// TODO: choise your quiz type:random, exam, by category, etc..
				finish();

				Intent intent = new Intent();
				intent.setClass(ChooseQuizActivity.this, RandomQuizActivity.class);
				startActivity(intent);			}
		});

		//Temporary: Call LinearQuizActivity using a button
		//ImageButton btnLinear = (ImageButton) findViewById(R.id.btnCallLinear);
		Button btnLinear = (Button) findViewById(R.id.btnCallLinear);
		btnLinear.setTypeface(tf);
		btnLinear.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {

				// TODO: choise your quiz type:random, exam, by category, etc..
				finish();

				Intent intent = new Intent();
				intent.setClass(ChooseQuizActivity.this, ChooseStartIndexActivity.class);
				startActivity(intent);			}
		});

		//Temporary: Call CategoryListQuizActivity using a button
		Button btnCategoryList = (Button) findViewById(R.id.btnCallCategoryList);
		btnCategoryList.setTypeface(tf);
		btnCategoryList.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {

				// TODO: choise your quiz type:random, exam, by category, etc..
				finish();

				Intent intent = new Intent();
				intent.setClass(ChooseQuizActivity.this, ChooseCategoryActivity.class);
				startActivity(intent);			}
		});
		
		//Temporary: Call CategoryListQuizActivity using a button
		Button btnExam = (Button) findViewById(R.id.btnCallExam);
		btnExam.setTypeface(tf);
		btnExam.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {

				// TODO: choise your quiz type:random, exam, by category, etc..
				finish();

				Intent intent = new Intent();
				intent.setClass(ChooseQuizActivity.this, ExamQuizActivity.class);
				startActivity(intent);			}
		});
	}
	
	@Override
	protected String getDebugTag() {
		return DEBUG_TAG;
	}		
}